<script type="text/html" template lay-done="layui.data.sendParams(d.params)">
  <div class="layui-form" lay-filter="form_online">
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">是否支持转售</label>
      <div class="layui-input-inline">
        <input type="checkbox" name="can_resale" lay-skin="switch" lay-text="是|否"
               {{d.params.configs.resale_forbid==0?'checked':''}}>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">转售冷却期</label>
      <div class="layui-input-inline" style="width: 80px">
        <input type="number" class="layui-input" lay-verify="required" name="resale_duration"
               value="{{d.params.configs.resale_duration || 0}}">
      </div>
      <div class="layui-inline layui-form-mid layui-word-aux">
        天, 没有冷却期限制则填0
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">转售价格上限</label>
      <div class="layui-input-inline" style="width: 80px">
        <input type="number" class="layui-input" lay-verify="required" name="resale_max_price"
               value="{{d.params.configs.resale_max_price || 0}}">
      </div>
      <div class="layui-inline layui-form-mid layui-word-aux">
        元，为0时代表无上限
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">最大涨幅</label>
      <div class="layui-input-inline" style="width: 80px">
        <input type="number" class="layui-input" lay-verify="required" name="resale_price_incr_limit"
               value="{{d.params.configs.resale_price_incr_limit || 0}}">
      </div>
      <div class="layui-inline layui-form-mid layui-word-aux">
        %，为0时表示不限制
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">最大跌幅</label>
      <div class="layui-input-inline" style="width: 80px">
        <input type="number" class="layui-input" lay-verify="required" name="resale_price_decr_limit"
               value="{{d.params.configs.resale_price_decr_limit || 0}}">
      </div>
      <div class="layui-inline layui-form-mid layui-word-aux">
        %，为0时表示不限制
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">初始基准价</label>
      <div class="layui-input-inline" style="width: 80px">
        <input type="number" class="layui-input" lay-verify="required" name="resale_init_base_price"
               value="{{d.params.configs.resale_init_base_price || 0}}">
      </div>
      <div class="layui-inline layui-form-mid layui-word-aux">
        元，商品初次上架二级市场时涨跌幅计算的基准
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">是否支持转赠</label>
      <div class="layui-input-inline">
        <input type="checkbox" name="can_give" lay-skin="switch" lay-text="是|否"
               {{d.params.configs.give_forbid==0?'checked':''}}>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 120px">转赠冷却期</label>
      <div class="layui-input-inline" style="width: 100px">
        <input type="number" class="layui-input" lay-verify="required" name="give_duration"
               value="{{d.params.configs.give_duration || 0}}">
      </div>
      <div class="layui-inline layui-form-mid layui-word-aux">
        天, 没有冷却期限制则填0
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-footer">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
          <input type="button" lay-submit lay-filter="submit_resale" value="确认" class="layui-btn">
        </div>
      </div>
    </div>
  </div>
</script>
<script>
  layui.data.sendParams = function (obj) {
    layui.use([], function () {
      let form = layui.form
        , laydate = layui.laydate

      form.render()
    })
  }
</script>
